#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>

#define flr(x,l,r) for (int x = l; x <= r; ++ x)
#define frl(x,r,l) for (int x = r; x >= l; -- x)
#define LL long long 
#define szf sizeof
#define in(x) scanf("%d", &x)
#define out(x) printf("%d", x)
#define inll(x) scanf("%lld", &x)
#define outll(x) printf("%lld", x)
#define pn printf("\n")
#define con continue
#define bk break
#define vc vector 
#define pb push_back
#define sz size
#define PII pair<int, int>

using namespace std;

const int N = 3e5 + 10;

int n, s;
LL c[N], t[N], f[N];
int q[N];

int main() {
	in(n), in(s);
	
	flr (i, 1, n) {
	    inll(t[i]), inll(c[i]);
	    t[i] += t[i - 1], c[i] += c[i - 1];
	}
	
	int hh = 0, tt = 0;
    flr (i, 1, n) {
        while (hh < tt && (f[q[hh + 1]] - f[q[hh]]) <= 
                (t[i] + s) * (c[q[hh + 1]] - c[q[hh]])) hh ++ ;
        int j = q[hh];
        f[i] = f[j] - (t[i] + s) * c[j] + t[i] * c[i] + s * c[n];
        while (hh < tt && (f[q[tt]] - f[q[tt - 1]]) * (c[i] - c[q[tt]]) >= 
                (f[i] - f[q[tt]]) * (c[q[tt]] - c[q[tt- 1]])) tt -- ;
        q[ ++ tt] = i;
        
    }
	
	outll(f[n]), pn;
	
	return 0;
}